//
// Decompiled by Jadx - 373ms
//
package gf;

import de.robv.android.xposed.XposedHelpers;
import fn.j;
import fn.x;
import fn.y;
import fo.c;
import o.a;
import org.luckypray.dexkit.query.matchers.ClassMatcher;
import org.luckypray.dexkit.query.matchers.FieldMatcher;
import org.luckypray.dexkit.query.matchers.FieldsMatcher;
import org.luckypray.dexkit.query.matchers.MethodMatcher;
import org.luckypray.dexkit.query.matchers.MethodsMatcher;
import org.luckypray.dexkit.result.ClassData;
import org.luckypray.dexkit.result.FieldData;
import org.luckypray.dexkit.result.FieldDataList;
import org.luckypray.dexkit.result.MethodData;

@a("WX")
public final class ab extends x {
    public static String cp;
    public static String cq;
    public static String cr;
    public static String cs;
    public static Object ct;
    public static Object cu;
    public static Object cv;
    public static Object cw;

    public static void cx() {
        if (y.by.isLoadAllUserData()) {
            try {
                MethodData t = c.t(MethodMatcher.create().declaredClass(y.cj("MvvmList")).usingStrings(new String[]{"submitRefreshAll"}));
                cs = t.getMethodName();
                if (b.cp != null) {
                    if (t.getParamCount() > 0) {
                        j.ad(j.ak(y.cj("MvvmList")), cs, new Object[]{b.cp, null, 1, null});
                    } else {
                        j.aa(b.cp, cs);
                    }
                }
            } catch (IndexOutOfBoundsException e) {
                j.bi(new Object[]{"刷新通讯录失败:" + e.getMessage()});
                e.printStackTrace();
            }
            try {
                if (cw == null) {
                    cw = j.aa(j.ad(j.ak(cp), cq, new Object[0]), cr);
                }
                Object obj = cw;
                if (obj == null || obj.getClass().getSuperclass() == null) {
                    j.bi(new Object[]{"刷新消息列表失败"});
                    return;
                }
                MethodData t2 = c.t(MethodMatcher.create().declaredClass(cw.getClass().getSuperclass()).paramTypes(new String[]{"int", null, Object.class.getName()}));
                if (t2 != null) {
                    j.ab(cw, t2.getMethodName(), new Object[]{5, cw, ""});
                }
            } catch (XposedHelpers.InvocationTargetError e2) {
                e2.printStackTrace();
                j.bi(new Object[]{e2.getMessage()});
            }
        }
    }

    public static void cy(String str) {
        if (y.by.isLoadAllUserData()) {
            try {
                if (cw == null) {
                    cw = j.aa(j.ad(j.ak(cp), cq, new Object[0]), cr);
                }
                Object obj = cw;
                if (obj == null || obj.getClass().getSuperclass() == null) {
                    j.bi(new Object[]{"刷新个人消息失败"});
                } else {
                    j.ab(cw, c.t(MethodMatcher.create().declaredClass(cw.getClass().getName()).paramTypes(new String[]{"java.lang.String"}).usingStrings(new String[]{"update conversation failed", "updateUnreadByTalker %s"})).getMethodName(), new Object[]{str});
                }
            } catch (XposedHelpers.InvocationTargetError e) {
                e.printStackTrace();
                j.bi(new Object[]{e.getMessage()});
            }
        }
    }

    public final void a() {
        FieldData o;
        j.ay(c.n(ClassMatcher.create().usingEqStrings(new String[]{"MicroMsg.SqliteDB"})).getName(), new a());
        j.ay("com.tencent.mm.ui.conversation.ConversationListView", new b());
        ClassData n = c.n(ClassMatcher.create().fieldCount(2).fields(FieldsMatcher.create().add(FieldMatcher.create().modifiers(16)).add(FieldMatcher.create().modifiers(72))).modifiers(16).methods(MethodsMatcher.create().add(MethodMatcher.create().returnType("boolean").modifiers(8).paramCount(0)).add(MethodMatcher.create().returnType("boolean").modifiers(8).paramCount(0)).add(MethodMatcher.create().returnType("void").modifiers(8).paramCount(0))));
        cp = n.getName();
        FieldDataList fields = n.getFields();
        FieldMatcher modifiers = FieldMatcher.create().modifiers(16);
        synchronized (c.class) {
            o = c.o(fields, modifiers, 0);
        }
        MethodData t = c.t(MethodMatcher.create().declaredClass(n.getName()).returnType(o.getType().getName()));
        cq = t.getMethodName();
        if (t.getReturnType() != null) {
            cr = c.t(MethodMatcher.create().declaredClass(t.getReturnType().getName()).returnType(ClassMatcher.create().fieldCount(2).modifiers(512))).getMethodName();
        }
    }
}
